print("我的名字是%s，我的学号是%s"%("董家萁","0306201106"))
import random

# 随机抽取
f = open("全部名单.txt", "r", encoding="utf-8")
a = f.readlines()
b = random.choice(a)
print(b)

# 保存至新名单
f = open("已抽中名单.txt", "a", encoding="utf-8")
f.write(b)

# 删除选中的学生
a.remove(b)
f = open("全部名单.txt", "w", encoding="utf-8")
f.writelines(a)

f.close()






